﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Store
{
    class Program
    {
        static void Main(string[] args)
        {
            Store ApStore = new Store("ApStore","USA");

            SalesManager Misha = new SalesManager("Миша", 3, 100);
            SalesManager Aristarh = new SalesManager("Аристарх", 5, 300);
            SalesManager Arkashka = new SalesManager("Аркашка", 2, 400);

            ApStore.HireSalesManager(Misha);
            ApStore.HireSalesManager(Arkashka);
        }
    }

    public class Store
    {
        private string _name;
        private string _address;
        private SalesManager[] _salMan ;
        private int arrayPointer = 0;

        public string Name
        {
            get { return _name;}

            set 
            {               
               _name = value;
            }
        }
        public string Address
        {
            get
            {
                return _address;
            }
            set
            {
                value = _address;
            }
        }
        public SalesManager[] SalMan
        {
            get
            {
                return _salMan;
            }

        }

        public Store()
        {
            _name = "0";
            _address = "0";
            _salMan = new SalesManager[10];
        }
        public Store(string name,string address)
        {
            _name    = name;
            _address = address;
        }
        public Store(string name,string address, SalesManager[] sm):this()
        {

            _salMan  = sm; 
        }


        public void HireSalesManager(SalesManager newManager)
        {
            newManager.SelManId = arrayPointer;
            _salMan[arrayPointer++] = newManager;
            
        }
        
        public void FireSalesManager(int id)
        {
 
        }

    }

    public class SalesManager
    {
        private string _name;
        private int _experience;
        private int _salary;
        private int _selManId;

        public string Name
        {
            get
            {
                return _name;
            }
            set
            {
                value = _name;
            }
        }
        public int Experians
        {
            get
            {
                return _experience;
            }
            set
            {
                if (value > 10)
                {
                    value = _experience;
                    _salary += 10;
                }

            }
        }
        public int Salary
        {
            get
            {
                return _salary;
            }
            set
            {
                if (value >= 10)
                {
                    _salary = value;

                }
            }
        }
        public int SelManId
        {
            get { return _selManId; }
            set { _selManId = value; }
        }

        public SalesManager()
        {

        }
        public SalesManager(string Name):this()
        {
            _name = Name;
        } 
        public SalesManager(string Name,int Expirians):this(Name)
        {
            _experience = Expirians;
        }
        public SalesManager(string Name, int Expirians, int Salary): this(Name,Expirians)
        {
            _salary = Salary;
        }
       
    }
}